#include "../include/BSTree.h"


int main(){
	int a[100];
	int i,n;
	printf("please input the number of element: ");
	scanf("%d",&n);
	printf("please input the elements:\n");
	for(i=0;i<n;i++){
		scanf("%d",a+i);
	}
	BTreeNode *tree = createBSTree(a,n);

	printByDFS(tree);
	printf("\n");	
	int num;
	printf("input the number you want to delete:\n");
	scanf("%d",&num);
	tree = deleteElement(tree,num);
	printf("%d\n",tree->value);	
	printByDFS(tree);
	printf("\n");

	BTreeNode *list = changeIntoList(tree);
	while(list != NULL){
		printf("%d ",list->value);
		list = list->leftNode;
	}
	printf("\n");
	
	return 0;
}
